<!DOCTYPE html>

<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Home</title>

  <!-- plugins:css -->
  <link rel="stylesheet" th:href="@{/static/x/vendors/mdi/css/materialdesignicons.min.css}">
  <link rel="stylesheet" th:href="@{/static/x/vendors/base/vendor.bundle.base.css}">
  <!-- endinject -->
  <!-- plugin css for this page -->
  <link rel="stylesheet" th:href="@{/static/x/vendors/datatables.net-bs4/dataTables.bootstrap4.css}">
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" th:href="@{/static/x/css/style.css}">

  <link rel="stylesheet" th:href="@{/static/x/css/bootstrap.css}">
  <!-- endinject -->
  <link rel="shortcut icon" th:href="@{/static/x/images/favicon.png}" />
  <script type="text/javascript" th:src="@{static/x/js/jquery-3.4.1.min.js}"></script>
  <script type="text/javascript" th:src="@{static/x/js/bootstrapValidator.min.js}"></script>
  <script type="text/javascript" th:src="@{static/x/js/bootstrap.min.js}"></script>
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js"></script>
</head>
<body>
<div class="container-scroller">
  <!-- partial:partials/_navbar.html -->
  <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
    <div class="navbar-brand-wrapper d-flex justify-content-center">
      <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">
        <a class="navbar-brand brand-logo" href="index.html"><img src="images/logo.svg" alt="logo"/></a>
        <a class="navbar-brand brand-logo-mini" href="index.html"><img src="images/logo-mini.svg" alt="logo"/></a>
        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
          <span class="mdi mdi-sort-variant"></span>
        </button>
      </div>
    </div>
    <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
      <ul class="navbar-nav mr-lg-4 w-100">
        <li class="nav-item nav-search d-none d-lg-block w-100">
          <div class="input-group">
            <div class="input-group-prepend">
                <span class="input-group-text" id="search">
                  <i class="mdi mdi-magnify"></i>
                </span>
            </div>
            <input type="text" class="form-control" placeholder="Search now" aria-label="search" aria-describedby="search">
          </div>
        </li>
      </ul>
      <ul class="navbar-nav navbar-nav-right">
        <li class="nav-item dropdown mr-1">
          <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center" id="messageDropdown" href="#" data-toggle="dropdown">
            <i class="mdi mdi-message-text mx-0"></i>
            <span class="count"></span>
          </a>
          <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="messageDropdown">
            <p class="mb-0 font-weight-normal float-left dropdown-header">Messages</p>
            <a class="dropdown-item">
              <div class="item-thumbnail">
                <img src="images/faces/face4.jpg" alt="image" class="profile-pic">
              </div>
              <div class="item-content flex-grow">
                <h6 class="ellipsis font-weight-normal">David Grey
                </h6>
                <p class="font-weight-light small-text text-muted mb-0">
                  The meeting is cancelled
                </p>
              </div>
            </a>
            <a class="dropdown-item">
              <div class="item-thumbnail">
                <img src="images/faces/face2.jpg" alt="image" class="profile-pic">
              </div>
              <div class="item-content flex-grow">
                <h6 class="ellipsis font-weight-normal">Tim Cook
                </h6>
                <p class="font-weight-light small-text text-muted mb-0">
                  New product launch
                </p>
              </div>
            </a>
            <a class="dropdown-item">
              <div class="item-thumbnail">
                <img src="images/faces/face3.jpg" alt="image" class="profile-pic">
              </div>
              <div class="item-content flex-grow">
                <h6 class="ellipsis font-weight-normal"> Johnson
                </h6>
                <p class="font-weight-light small-text text-muted mb-0">
                  Upcoming board meeting
                </p>
              </div>
            </a>
          </div>
        </li>
        <li class="nav-item dropdown mr-4">
          <a class="nav-link count-indicator dropdown-toggle d-flex align-items-center justify-content-center notification-dropdown" id="notificationDropdown" href="#" data-toggle="dropdown">
            <i class="mdi mdi-bell mx-0"></i>
            <span class="count"></span>
          </a>
          <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="notificationDropdown">
            <p class="mb-0 font-weight-normal float-left dropdown-header">Notifications</p>
            <a class="dropdown-item">
              <div class="item-thumbnail">
                <div class="item-icon bg-success">
                  <i class="mdi mdi-information mx-0"></i>
                </div>
              </div>
              <div class="item-content">
                <h6 class="font-weight-normal">Application Error</h6>
                <p class="font-weight-light small-text mb-0 text-muted">
                  Just now
                </p>
              </div>
            </a>
            <a class="dropdown-item">
              <div class="item-thumbnail">
                <div class="item-icon bg-warning">
                  <i class="mdi mdi-settings mx-0"></i>
                </div>
              </div>
              <div class="item-content">
                <h6 class="font-weight-normal">Settings</h6>
                <p class="font-weight-light small-text mb-0 text-muted">
                  Private message
                </p>
              </div>
            </a>
            <a class="dropdown-item">
              <div class="item-thumbnail">
                <div class="item-icon bg-info">
                  <i class="mdi mdi-account-box mx-0"></i>
                </div>
              </div>
              <div class="item-content">
                <h6 class="font-weight-normal">New user registration</h6>
                <p class="font-weight-light small-text mb-0 text-muted">
                  2 days ago
                </p>
              </div>
            </a>
          </div>
        </li>
        <li class="nav-item nav-profile dropdown">
          <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="profileDropdown">
            <img src="images/faces/face5.jpg" alt="profile"/>
            <span class="nav-profile-name">Louis Barnett</span>
          </a>
          <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
            <a class="dropdown-item">
              <i class="mdi mdi-settings text-primary"></i>
              Settings
            </a>
            <a class="dropdown-item">
              <i class="mdi mdi-logout text-primary"></i>
              Logout
            </a>
          </div>
        </li>
      </ul>
      <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
        <span class="mdi mdi-menu"></span>
      </button>
    </div>
  </nav>
  <!-- partial -->
  <div class="container-fluid page-body-wrapper">
    <!-- partial:partials/_sidebar.html -->
    <nav class="sidebar sidebar-offcanvas" id="sidebar">
      <ul class="nav">
        <li class="nav-item">
          <a class="nav-link" href="index.html">
            <i class="mdi mdi-home menu-icon"></i>
            <span class="menu-title">Dashboard</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" data-toggle="collapse" href="#ui-basic" aria-expanded="false" aria-controls="ui-basic">
            <i class="mdi mdi-circle-outline menu-icon"></i>
            <span class="menu-title">UI Elements</span>
            <i class="menu-arrow"></i>
          </a>
          <div class="collapse" id="ui-basic">
            <ul class="nav flex-column sub-menu">
              <li class="nav-item"> <a class="nav-link" href="pages/ui-features/buttons.html">Buttons</a></li>
              <li class="nav-item"> <a class="nav-link" href="pages/ui-features/typography.html">Typography</a></li>
            </ul>
          </div>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="pages/forms/basic_elements.html">
            <i class="mdi mdi-view-headline menu-icon"></i>
            <span class="menu-title">Form elements</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="pages/charts/chartjs.html">
            <i class="mdi mdi-chart-pie menu-icon"></i>
            <span class="menu-title">Charts</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="pages/tables/basic-table.html">
            <i class="mdi mdi-grid-large menu-icon"></i>
            <span class="menu-title">Tables</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" th:href="@{/
            alldancer}">
            <i class="mdi mdi-emoticon menu-icon"></i>
            <span class="menu-title">舞者信息</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" data-toggle="collapse" href="#auth" aria-expanded="false" aria-controls="auth">
            <i class="mdi mdi-account menu-icon"></i>
            <span class="menu-title">User Pages</span>
            <i class="menu-arrow"></i>
          </a>
          <div class="collapse" id="auth">
            <ul class="nav flex-column sub-menu">
              <li class="nav-item"> <a class="nav-link" th:href="@{/login}"> Login </a></li>
              <li class="nav-item"> <a class="nav-link" href="pages/samples/login-2.html"> Login 2 </a></li>
              <li class="nav-item"> <a class="nav-link" href="pages/samples/register.html"> Register </a></li>
              <li class="nav-item"> <a class="nav-link" href="pages/samples/register-2.html"> Register 2 </a></li>
              <li class="nav-item"> <a class="nav-link" href="pages/samples/lock-screen.html"> Lockscreen </a></li>
            </ul>
          </div>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="documentation/documentation.html">
            <i class="mdi mdi-file-document-box-outline menu-icon"></i>
            <span class="menu-title">Documentation</span>
          </a>
        </li>
      </ul>
    </nav>

    <!-- partial -->
    <div class="main-panel">
      <div class="content-wrapper">
        <div class="row">
          <div class="col-md-12 grid-margin">
            <div class="d-flex justify-content-between flex-wrap">
              <div class="d-flex align-items-end flex-wrap">
                <div class="mr-md-3 mr-xl-5">
                  <h2>Welcome back</h2>
                  <p class="mb-md-0">好不容易才完成的增删改查</p>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-md-12 stretch-card">
              <div class="card">
                <div class="card-body">
                  <h4 class="card-title">课程管理的信息如下：</h4>
                  <p class="card-description">
                  <h2><a class="btn btn-secondary" th:href="@{/course/emp}">增加课程</a></h2>
                  </p>
                  <div class="table-responsive">
                    <table class="table table-striped" id="recent-purchases-listing">
                      <thead>
                      <tr>
                        <th>
                          ID
                        </th>
                        <th>
                          课程名字
                        </th>
                        <th>
                          任职老师
                        </th>
                        <th>
                          上课人数
                        </th>
                        <th>
                          课程费用
                        </th>
                        <th>
                          舞者id
                        </th>
                        <th>
                          学生id
                        </th>
                        <th>
                          购买状态
                        </th>
                        <th>
                          课程时间
                        </th>
                        <th>
                          课时
                        </th>
                        <th>
                          操作
                        </th>
                        <th>
                          操作
                        </th>

                      </tr>
                      </thead>
                      <tbody>
                      <tr th:each="emp:${pageInfo.list}">
                        <td th:text="${emp.id}"></td>
                        <td th:text="${emp.coursename}"></td>
                        <td th:text="${emp.dancername}"></td>
                        <td th:text="${emp.coursenumber}"></td>
                        <td th:text="${emp.coursemoney}+' 元'"></td>
                        <td th:text="${emp.dancerid}"></td>
                        <td th:text="${emp.studentid}"></td>
                        <td th:text="${emp.PurchaseStatus}"></td>
                        <td th:text="${emp.coursetime}"></td>
                        <td th:text="${emp.courseclass}"></td>
                        <td><!-- Large modal -->
                          <a class="btn btn-primary btn-sm" th:href="@{/course/emp/}+${emp.id}">编辑</a>
                        </td>
                        <td >
                          <!--方法一 会有很多个表单出现-->
                          <!--<form th:action="@{/emp/}+${emp.id}" method="post">-->
                          <!--<input type="hidden" name="_method" value="delete"/>-->
                          <!--<button type="submit" class="btn btn-sm btn-danger deleteBtn">删除</button>-->
                          <!--</form>-->
                          <button th:attr="del_uri=@{/course/emp/}+${emp.id}" class="btn btn-sm btn-danger deleteBtn">删除</button>
                        </td>
                      </tr>
                      </tbody>

                    </table>
                    <!--显示分页信息-->
                    <div class="modal-footer no-margin-top">
                      <div class="col-md-6">
                        当前第 [[${pageInfo.pageNum}]]页,共 [[${pageInfo.pages}]] 页.一共 [[${pageInfo.total}]] 条记录
                      </div>

                      <ul class="pagination pull-right no-margin">
                        <li th:if="${pageInfo.hasPreviousPage}">
                          <a th:href="'/course/findcourselist?pageNum=1'">首页</a>
                        </li>

                        <li class="prev" th:if="${pageInfo.hasPreviousPage}">
                          <a th:href="'/course/findcourselist?pageNum='+${pageInfo.prePage}">
                            <i class="mdi mdi-arrow-left"></i>
                          </a>
                        </li>
                        <!--遍历条数-->
                        <li th:each="nav:${pageInfo.navigatepageNums}">
                          <a th:href="'/course/findcourselist?pageNum='+${nav}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"></a>
                          <span style="font-weight: bold;background: #6faed9;" th:if="${nav == pageInfo.pageNum}" th:text="${nav}" ></span>
                        </li>

                        <li class="next" th:if="${pageInfo.hasNextPage}">
                          <a th:href="'/course/findcourselist?pageNum='+${pageInfo.nextPage}">
                            <i class="mdi mdi-arrow-right"></i>
                          </a>
                        </li>

                        <li>
                          <a th:href="'/course/findcourselist?pageNum='+${pageInfo.pages}">尾页</a>
                        </li>
                      </ul>
                    </div>

                    <div>当前页号：<span th:text="${pageInfo.pageNum}"></span></div>
                    <div>每页条数：<span th:text="${pageInfo.pageSize}"></span></div>
                    <div>起始行号：<span th:text="${pageInfo.startRow}"></span></div>
                    <div>终止行号：<span th:text="${pageInfo.endRow}"></span></div>
                    <div>总结果数：<span th:text="${pageInfo.total}"></span></div>
                    <div>总页数：<span th:text="${pageInfo.pages}"></span></div>
                    <hr />
                    <div>是否为第一页：<span th:text="${pageInfo.isFirstPage}"></span></div>
                    <div>是否为最后一页：<span th:text="${pageInfo.isLastPage}"></span></div>
                    <div>是否有前一页：<span th:text="${pageInfo.hasPreviousPage}"></span></div>
                    <div>是否有下一页：<span th:text="${pageInfo.hasNextPage}"></span></div>

                  </div>
                </div>
              </div>
            </div>
          </div>
          <form id="deleteEmpForm"  method="post">
            <input type="hidden" name="_method" value="delete"/>
          </form>


          <!-- partial -->
        </div>
        <!-- main-panel ends -->
      </div>
      <!-- page-body-wrapper ends -->
    </div>
    <!-- plugins:js -->
    <script th:src="@{static/x/vendors/base/vendor.bundle.base.js}"></script>
    <!-- endinject -->
    <!-- Plugin js for this page-->
    <script th:src="@{static/x/vendors/chart.js/Chart.min.js}"></script>
    <script th:src="@{static/x/vendors/datatables.net/jquery.dataTables.js}"></script>
    <script th:src="@{static/x/vendors/datatables.net-bs4/dataTables.bootstrap4.js}"></script>
    <!-- End plugin js for this page-->
    <!-- inject:js -->
    <script th:src="@{static/x/js/off-canvas.js}"></script>
    <script th:src="@{static/x/js/hoverable-collapse.js}"></script>
    <script th:src="@{static/x/js/template.js}"></script>
    <!-- endinject -->
    <!-- Custom js for this page-->
    <script th:src="@{static/x/js/dashboard.js}"></script>
    <script th:src="@{static/x/js/data-table.js}"></script>
    <script th:src="@{static/x/js/jquery.dataTables.js}"></script>
    <script th:src="@{static/x/js/dataTables.bootstrap4.js}"></script>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js"></script>
      </script>
      <script>
      $(".deleteBtn").click(function(){
          //删除当前员工的
          if(confirm('确定要删除该舞者吗?')) {
              $("#deleteEmpForm").attr("action", $(this).attr("del_uri")).submit();
              return false;
          }
      });





    </script>
    <!-- End custom js for this page-->
</body>

</html>

